﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data.SqlTypes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace App.Model
{
    /// <summary>
    /// 采样记录
    /// </summary>
    public class ProSampling
    {
        /// <summary>
        /// 采样编号
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        [VGridColumn(HeaderText = "采样编号", DisplayIndex = 0, Visible = false)]
        public int SamplingId { get; set; }

        /// <summary>
        /// 批次
        /// </summary>
        [VGridColumn(HeaderText = "批次", DisplayIndex = 1, Width = 55, Alignment = "Center")]
        public int LocalBatch { get; set; }

        /// <summary>
        /// 每个车在该车次中的顺序
        /// </summary>
        [VGridColumn(HeaderText = "位置", DisplayIndex = 2, Width = 55, Alignment = "Center")]
        public int TrainIndex { get; set; }

        /// <summary>
        /// 是否采样成功 待采 完成 弃采
        /// </summary>
        [VGridColumn(HeaderText = "状态", DisplayIndex = 3, Width = 60, Alignment = "Center")]
        public string IsSuccess { get; set; }

        /// <summary>
        /// 是否上传
        /// </summary>
        [VGridColumn(HeaderText = "上传", DisplayIndex = 4, Width = 60, Alignment = "Center")]
        public string IsUpload { get; set; }

        /// <summary>
        /// 时间
        /// </summary>
        [VGridColumn(HeaderText = "入厂时间", DisplayIndex = 5, Width = 175, Alignment = "Center")]
        [SugarColumn(IsIgnore = true)]
        public string CreateTimeStr { get; set; }

        /// <summary>
        /// 采样坐标
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(256)", IsNullable = true)]
        [VGridColumn(HeaderText = "采样坐标", DisplayIndex = 6, Width = 200)]
        public string SimplingLocation { get; set; }

        /// <summary>
        /// 实际 采样坐标
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(256)", IsNullable = true)]
        [VGridColumn(HeaderText = "实际采样坐标", DisplayIndex = 7, Width = 200)]
        public string ActualSimplingLocation { get; set; }

        /// <summary>
        /// 虚拟 采样坐标 用于三大项回传
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(256)", IsNullable = true)]
        public string VirtuallySimplingLocation { get; set; }

        /// <summary>
        /// 采样开始时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        [VGridColumn(HeaderText = "采样开始时间", DisplayIndex = 8, Width = 175, Alignment = "Center")]
        public string SamplingStartTime { get; set; }

        /// <summary>
        /// 采样结束时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        [VGridColumn(HeaderText = "采样结束时间", DisplayIndex = 9, Width = 175, Alignment = "Center")]
        public string SamplingEndTime { get; set; }

        /// <summary>
        /// 集样罐号
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "罐号", DisplayIndex = 10, Alignment = "Center", Width = 55)]
        public string SetBucketNo { get; set; }

        /// <summary>
        /// 车号 1821998
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "车号", DisplayIndex = 11, Width = 80, Alignment = "Center")]
        public string CarNo { get; set; }

        /// <summary>
        /// 采样点数
        /// </summary>
        [VGridColumn(HeaderText = "点数", Width = 55, DisplayIndex = 12, Alignment = "Center")]
        public int SimplingPoint { get; set; }

        /// <summary>
        /// 车次号
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "车次号", Width = 100, Alignment = "Center")]
        public string TravelNo { get; set; }

        /// <summary>
        /// 入厂批次号
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "入厂批次号", Width = 100, Visible = false)]
        public string BatchInfoId { get; set; }

        /// <summary>
        /// 时间
        /// </summary>
        [VGridColumn(HeaderText = "入厂时间", Width = 160, Visible = false)]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 采样方式
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "采样方式", Visible = false)]
        public string SimplingSource { get; set; }

        /// <summary>
        /// 火车宽度
        /// </summary>
        [VGridColumn(HeaderText = "火车宽度", Visible = false)]
        public decimal TransWide { get; set; }

        /// <summary>
        /// 火车长度
        /// </summary>
        [VGridColumn(HeaderText = "火车长度", Visible = false)]
        public decimal TransLong { get; set; }

        /// <summary>
        /// 拉筋位置
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(512)", IsNullable = true)]
        [VGridColumn(HeaderText = "拉筋位置", Visible = false)]
        public string Stretchposition { get; set; }

        /// <summary>
        /// 车型
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "车型", Width = 70, Alignment = "Center")]
        public string CarType { get; set; }

        /// <summary>
        /// 采样方案编号
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "采样方案编号", Visible = false)]
        public string TrainSamplingCode { get; set; }

        /// <summary>
        /// 三大项编号
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)")]
        [VGridColumn(HeaderText = "三大项编号", Visible = false)]
        public string SdxId { get; set; }

        /// <summary>
        /// 供应商简码
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "供应商简码", Visible = true)]
        public string SupplierCode { get; set; }

        /// <summary>
        /// 采样机编号
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "采样机编号", Visible = false)]
        public string SimplingCode { get; set; }

        /// <summary>
        /// 是否已过重
        /// </summary>
        [VGridColumn(HeaderText = "是否已过重", Visible = false)]
        public int IsWeight { get; set; }

        /// <summary>
        /// 机构标识
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "机构标识", Visible = false)]
        public string OrgId { get; set; }

        /// <summary>
        /// 系统标识
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(64)", IsNullable = true)]
        [VGridColumn(HeaderText = "系统标识", Visible = false)]
        public string SysId { get; set; }

        /// <summary>
        /// 空车0车皮，1为正常
        /// </summary>
        [VGridColumn(HeaderText = "装车状态", Visible = false)]
        public decimal CanSampling { get; set; }

        /// <summary>
        /// 子样重量
        /// </summary>
        [VGridColumn(HeaderText = "子样重量", Alignment = "Center")]
        [SugarColumn(ColumnDataType = "VARCHAR(12)", IsNullable = true)]
        public string SimplingWeight { get; set; }

        /// <summary>
        /// 采样图片地址
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(512)", IsNullable = true)]
        [VGridColumn(HeaderText = "采样图片地址", Visible = false)]
        public string SimplingPic { get; set; }

        /// <summary>
        /// 采样员
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(32)", IsNullable = true)]
        public string SamplingPerson { get; set; }

        /// <summary>
        /// 是否测试
        /// </summary>
        [SugarColumn(ColumnDataType = "VARCHAR(32)", IsNullable = true)]
        public string IsTest { get; set; }


        [SugarColumn(IsIgnore = true)]
        public   List<ProSamplingPos> PosList { get; set; }

        [SugarColumn(IsIgnore = true)]
        public   List<string> BlockList { get; set; }

        /// <summary>
        /// 待上传的图片对象
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public byte[] UploadPicObj { get; set; }

        /// <summary>
        /// 待上传的图片地址
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string UploadPicPath { get; set; }

        /// <summary>
        /// 桶号
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int PailNo { get; set; }

    }
}
